/**CopyRight[1990-2012]<lyc2877@gmail.com>
 */
#ifndef MYIPCS_INCLUDE_PROCESSMANAGER_H_
#define MYIPCS_INCLUDE_PROCESSMANAGER_H_

#include "Common.h"
#include "MQueue.h"
#include "WorkerFactory.h"
void* thread(void* in_pv);

class CProcessManager {
 public:
  void process_logic(int , char**);
  void startup();
  void shutdown();
  void stop();
  bool lock(int in_nMode);
  int32_t create_thread(int64_t in_lType, int in_nNum);
  
  CMQueue *m_pMQueue;
  CWorkerFactory* m_Factory;
//*************************************************
  static CProcessManager* GetInstance();
  CProcessManager();
  ~CProcessManager();
 private:
  set<pthread_t> m_SetThreadPid;
  set<CThread*>  m_SetThreadClass;
  static CProcessManager *m_pInstance;
  int m_nLockFd;
};
#define PROCESS  CProcessManager::GetInstance()

#endif  // MYIPCS_INCLUDE_PROCESSMANAGER_H_
